# This file is part of Laivsys 2. See doc/README_FOR_APP for more information
# and licence.
# (C) Sigve Indregard 
# $Id: laiv_user.rb 44 2007-11-29 22:56:58Z sigve.indregard $

# LaivUser is a join model for Laiv and User objects. This could have been 
# made into a has_and_belongs_to_many, but this is put here for the future
# possibility of adding user levels.
class LaivUser < ActiveRecord::Base
  belongs_to :laiv
  belongs_to :user

  validates_presence_of :laiv_id, :user_id
  validates_associated :laiv, :user
  validates_uniqueness_of :user_id, :scope => :laiv_id
end
